package server.business.pojo;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import server.business.converter.BackRejectReasonConverter;
import server.business.converter.Converter.StateConverter;

import java.io.Serializable;
import java.util.Date;

/**
 * 整体输血信息表
 *
 * @author Galaxy
 * @TableName overall_blood
 */
@TableName(value = "overall_blood")
@Data
public class OverallBlood implements Serializable {
    /**
     * 编号
     */
    @ExcelProperty("编号")
    @ColumnWidth(10)
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 创建时间
     */
    @ExcelIgnore
    @TableField(value = "gmt_create")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date gmtCreate;

    /**
     * 修改时间
     */
    @ExcelIgnore
    @TableField(value = "gmt_modified")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date gmtModified;

    /**
     * 病历号
     */
    @ExcelProperty("病历号")
    @ColumnWidth(10)
    @TableField(value = "medical_record_number")
    private String medicalRecordNumber;

    /**
     * 患者编号
     */
    @ExcelProperty("患者编号")
    @ColumnWidth(10)
    @TableField(value = "patient_id")
    private String patientId;

    /**
     * 输血单号
     */
    @ExcelProperty("输血单号")
    @ColumnWidth(10)
    @TableField(value = "transfusion_number")
    private String transfusionNumber;

    /**
     * 血样编号
     */
    @ExcelProperty("血样编号")
    @ColumnWidth(10)
    @TableField(value = "blood_sample_number")
    private String bloodSampleNumber;

    /**
     * 配血单编号
     */
    @ExcelProperty("配血单编号")
    @ColumnWidth(10)
    @TableField(value = "blood_dispense_number")
    private String bloodDispenseNumber;

    /**
     * 用血时间
     */
    @ExcelIgnore
    @TableField(value = "usage_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date usageTime;

    /**
     * 用血类型（弃用）
     */
    @ExcelIgnore
    @TableField(value = "usage_type")
    private String usageType;

    /**
     * 血袋信息（弃用）
     */
    @ExcelIgnore
    @TableField(value = "blood_bag_information")
    private String bloodBagInformation;

    /**
     * 是否允许退血
     */
    @ExcelProperty(value = "是否允许退血")
    @ColumnWidth(10)
    @TableField(value = "is_allowed_back")
    private Integer isAllowedBack;

    /**
     * 状态
     */
    @ExcelProperty(value = "状态",converter = StateConverter.class)
    @ColumnWidth(10)
    @TableField(value = "state")
    private String state;

    /**
     * 退血单号
     */
    @ExcelProperty("退血单号")
    @ColumnWidth(10)
    @TableField(value = "back_information_number")
    private String backInformationNumber;

    /**
     * 输血后评价编号
     */
    @ExcelProperty("输血后评价编号")
    @ColumnWidth(10)
    @TableField(value = "evaluation_number")
    private String evaluationNumber;

    /**
     * 不良反应编号
     */
    @ExcelProperty("不良反应编号")
    @ColumnWidth(10)
    @TableField(value = "adverse_reaction_number")
    private String adverseReactionNumber;

    /**
     * 退血驳回原因
     */
    @ExcelProperty(value = "退血驳回原因",converter = BackRejectReasonConverter.class)
    @ColumnWidth(10)
    @TableField(value = "reject_information")
    private String rejectInformation;

    @TableField(exist = false)
    private static final long serialVersionUID = -397060799672872143L;
}